class HistoryList{
  List list= [];
  int index = 0;
  int len;
  HistoryList({required this.len}){
    this.list= [];
    this.index= 0;
  }

  get(){
    return list;
  }
  //新增
  List add(String name){
    if(name == "") return [];

    list.insert(0, name);
    list = list.toSet().toList();
    if(list.length > this.len!){
      list.removeLast();
    }
    return list;
  }

  /**
   * 删除
   */
  List delete(String name){
    list.remove(name);
    return list.isEmpty ? [] : list;
  }




}